<?php
$page->BodyId = 'login';
$page->BodyClass = '';
$page->Section = '';

if ( !$page->Ajax ) {
	$page->Title = $page->Wordlets->GetWordlet('page_title');
	$page->SetWrapperFile('_wrapper');
}

?>

<div id="login_required">
	<h5>Login</h5>
	<form action="<?=$page->GetUrl('login', 'back_url=' . ((isset($_GET['back_url']))?urlencode($_GET['back_url']):urlencode('/')))?>" method="post">
		<p id="login_username" class="input text <?=( $page->Errors && $page->Errors['username'] )?'error':''?>">
			<? if ( $page->Errors && $page->Errors['username'] ) { ?>
				<span class="error">
					<?=implode(',', $page->Errors['username']) ?>
				</span>
			<? } ?>
			<label for="username">Username:</label>
			<input type="text" name="username" id="username" value="<?=$page->Username?>" />
		</p>
		<p id="login_password" class="input text">
			<label for="password">Password:</label>
			<input type="password" name="password" id="password" />
		</p>
		<p class="input submit"><input type="submit" value="Login" /></p>
	</form>
</div>